#ifndef __GAMELAYERCONFIGELEM_H__
#define __GAMELAYERCONFIGELEM_H__

#include "../Common/Ptr.h"
#include "../Common/Task.h"
#include "../Common/TaskThreadPool.h"

class GameLayerConfigElem : public PtrClass
{
public:
	GameLayerConfigElem()
		:mName("")
		,mWidth(0)
		,mHeight(0)
		,mPosX(0)
		,mPosY(0)
		,mZOrder(0)
		,mXT(false)
		,mYT(false)
	{
	}
public:
	virtual CCNode* Create() = 0;
	virtual void MTLoad(CCNode* parent);
public:
	CSString mName;
	float mWidth;
	float mHeight;
	float mPosX;
	float mPosY;
	int mZOrder;
	bool mXT;
	bool mYT;
};

class GameLayerConfigLayer : public GameLayerConfigElem
{
public:
	CCNode* Create();
public:
	CSList<GameLayerConfigElem*> mSubElemLst;
};

class GameLayerConfigButton : public GameLayerConfigElem
{
public:
	GameLayerConfigButton()
		:mNormalImage("")
		,mSelectedImage("")
		,mDisabledImage("")
		,mText("")
		,mFont("")
		,mFontSize(0)
	{
	}
public:
	CCNode* Create();
public:
	CSString mNormalImage;
	CSString mSelectedImage;
	CSString mDisabledImage;
	CSString mText;
	CSString mFont;
	int mFontSize;
};

class GameLayerConfigSprite : public GameLayerConfigElem
{
public:
	GameLayerConfigSprite()
		:mImage("")
		,mText("")
		,mFont("")
		,mFontSize(0)
	{
	}
public:
	CCNode* Create();
public:
	CSString mImage;
	CSString mText;
	CSString mFont;
	int mFontSize;
};



class InterfaceLoadTask : public Task
{
public:
	InterfaceLoadTask();
	InterfaceLoadTask(InterfaceLoadTask &other);
	~InterfaceLoadTask();
public:
	void DoTask();
	void SetParent(CCNode* parent);
public:
	CCNode* mParent;
	GameLayerConfigElem* mConfig;
};



#endif
